/* ==SillyTavern Weibo Control App Styles== */
/* @name         Weibo Control App Styles for Mobile Extension */
/* @version      1.0.0 */
/* @description  微博控制应用的样式，包含弹窗、表单、按钮等样式 */
/* @author       Assistant */

/* ===== 弹窗容器样式 ===== */
.weibo-dialog-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
}

.weibo-dialog-container[style*='block'] {
  pointer-events: all;
}

/* ===== 弹窗遮罩样式 ===== */
.weibo-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

/* ===== 弹窗主体样式 ===== */
.weibo-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.2s ease;
}

.weibo-dialog.show {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ===== 弹窗头部样式 ===== */
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.dialog-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.close-btn i {
  font-size: 14px;
}

/* ===== 弹窗内容样式 ===== */
.dialog-content {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

/* 确认对话框内容 */
.confirm-dialog .dialog-content p {
  margin: 0;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  text-align: center;
}

/* 输入对话框内容 */
.input-dialog .dialog-content input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-dialog .dialog-content input:focus {
  border-color: #ff8500;
}

/* ===== 用户信息样式 ===== */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
}

.user-info .user-avatar {
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-details .username {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.user-details .account-badge {
  font-size: 12px;
  color: #666;
  background: #e8e8e8;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

/* ===== 发博输入区域样式 ===== */
.post-input-section {
  margin-bottom: 16px;
}

.post-input-section textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
  background: white !important; /* 强制白色背景 */
  color: black !important; /* 强制黑色文字 */
}

.post-input-section textarea:focus {
  border-color: #ff8500;
}

.post-input-section textarea::placeholder {
  color: #999 !important; /* 强制placeholder颜色 */
}

.char-count {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  font-size: 14px;
  color: #666;
}

/* ===== 发博选项样式 ===== */
.post-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 16px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.option-item:hover {
  background: #e8e8e8;
  color: #333;
}

.option-item i {
  font-size: 12px;
}

/* ===== 弹窗底部样式 ===== */
.dialog-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.dialog-footer button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: #f5f5f5;
  color: #666;
}

.cancel-btn:hover {
  background: #e8e8e8;
  color: #333;
}

.post-btn,
.confirm-btn {
  background: #ff8500;
  color: white;
}

.post-btn:hover,
.confirm-btn:hover {
  background: #ff7300;
}

.post-btn:disabled {
  background: #ccc;
  color: #999;
  cursor: not-allowed;
}

.post-btn.enabled {
  background: #ff8500;
  color: white;
}

/* ===== Toast 提示样式 ===== */
.weibo-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.weibo-toast-success {
  background: #52c41a;
}

.weibo-toast-error {
  background: #ff4d4f;
}

.weibo-toast-info {
  background: #1890ff;
}

/* ===== 响应式设计 ===== */
@media (max-width: 480px) {
  .weibo-dialog-overlay {
    padding: 16px;
  }

  .weibo-dialog {
    max-width: none;
    width: 100%;
    max-height: 90vh;
  }

  .dialog-header {
    padding: 12px 16px;
  }

  .dialog-header h3 {
    font-size: 16px;
  }

  .dialog-content {
    padding: 16px;
  }

  .user-info {
    padding: 10px;
    margin-bottom: 12px;
  }

  .user-details .username {
    font-size: 15px;
  }

  .post-input-section textarea {
    min-height: 80px;
    font-size: 15px;
  }

  .post-options {
    gap: 6px;
  }

  .option-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .dialog-footer {
    padding: 12px 16px;
    gap: 8px;
  }

  .dialog-footer button {
    padding: 10px 16px;
    font-size: 15px;
  }
}

@media (max-width: 320px) {
  .weibo-dialog-overlay {
    padding: 12px;
  }

  .dialog-header {
    padding: 10px 12px;
  }

  .dialog-content {
    padding: 12px;
  }

  .user-info {
    padding: 8px;
    gap: 8px;
  }

  .post-input-section textarea {
    min-height: 70px;
    padding: 10px;
    font-size: 14px;
  }

  .post-options {
    gap: 4px;
  }

  .option-item {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }

  .dialog-footer {
    padding: 10px 12px;
    gap: 6px;
  }

  .dialog-footer button {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* ===== 动画效果 ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

/* ===== 滚动条样式 ===== */
.dialog-content::-webkit-scrollbar {
  width: 6px;
}

.dialog-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ===== 焦点样式 ===== */
.weibo-dialog button:focus,
.weibo-dialog input:focus,
.weibo-dialog textarea:focus {
  outline: 2px solid #ff8500;
  outline-offset: 2px;
}

/* ===== 禁用状态样式 ===== */
.weibo-dialog button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.weibo-dialog button:disabled:hover {
  transform: none;
}
